package com.atguigu.gulimall.product.vo.sku;

import com.atguigu.gulimall.product.entity.SkuImagesEntity;
import com.atguigu.gulimall.product.entity.SkuInfoEntity;
import com.atguigu.gulimall.product.entity.SpuInfoDescEntity;
import lombok.Data;

import java.util.List;

@Data
public class SkuItemVo {
    /**
     * sku基本信息
     */
    private SkuInfoEntity info;

    /**
     * 是否有货
     */
    private Boolean hasStock = Boolean.TRUE;

    /**
     * sku图片信息
     */
    List<SkuImagesEntity> images;

    /**
     * sku销售属性组合
     */
    List<SkuItemSaleAttrVo> saleAttrVos;

    /**
     * spu介绍信息
     */
    SpuInfoDescEntity spuDesc;

    /**
     * spu 规格信息
     */
    List<SpuItemAttrGroupVo> groupVos;

    /**
     * 商品秒杀信息
     */
    SeckillInfoVo seckillInfo;

    @Data
    public static class SpuItemAttrGroupVo {
        private String groupName;
        private List<SpuBaseAttrVo> attrs;
    }

    @Data
    public static class SpuBaseAttrVo {
        private String attrName;
        private String attrValue;
    }

    @Data
    public static class SkuItemSaleAttrVo {
        private Long attrId;
        private String attrName;
        private List<AttrValWithSkuIdsVo> attrValues;
    }

    @Data
    public static class AttrValWithSkuIdsVo {
        private String attrValue;
        private String skuIds;
    }
}
